package lk.icta.core.dao;


import lk.icta.core.entity.Land;
import lk.icta.core.entity.LandRailway;
import lk.icta.user.entity.User;

import java.util.Date;
import java.util.EnumSet;
import java.util.List;


/**
 * @author Kusal Samarakoon
 */
public interface LandRailwayDAO {

    /**
     * Add a Land
     *
     * @param land The land to be added
     * @param user User requesting to add the land
     */
    public void addLand(LandRailway land, User user);

    /**
     * Updating a land
     *
     * @param land The land to be updated
     * @param user User requesting to update the land
     */
    public void updateLand(LandRailway land, User user);

    public List<LandRailway> getLandsByDistrictAndState(int districtId, LandRailway.State state, User user);

    /**
     * Returns a land corresponding to the given land id
     *
     * @param idUKey Id of the land
     * @param user   User requesting to search the land
     * @return The land corresponding to the given id
     */

    public LandRailway getLandByIdUKey(long idUKey, User user);

    /**
     * Returns a landRailway on given search criteria
     *
     * @param fileNo     File no
     * @param planNo     Plan no
     * @param lotNo      Plan no
     * @param holderName Holder Name
     * @param user       User requesting to search the land
     * @param pageNo     page number for pagination
     * @return The land corresponding to the given id
     */
    public List<LandRailway> searchDetailedLandsOfDSDivisionBySearchText(String fileNo, String planNo,
                                                                         String lotNo, String holderName, User user, int pageNo);

    public List getLandByFileNumberByUser(String fNo, User user);

    public List getLandByFileNumberByUserAndState(String fNo, User user, EnumSet<LandRailway.State> stateSet);

    public List getLandByFileNumber(String fNo);

    public List<Object[]> getAllLandStatistics(int id, String searchBy, LandRailway.State landState, Date fromDate, Date toDate, LandRailway.MigrationState migState);

    public List<LandRailway> getLandStatisticReport(int branchId, int trackId, int districtId, Date fromDate, Date toDate, LandRailway.State lState);

    public List<LandRailway> getLandDetailsList(int branchId, int railwayTrackId, int districtId, Date startDate, Date endDate, LandRailway.State landState);

    public List<LandRailway> getLandLikeFileNumber(String landFileNumber);
}
